//解决跨域
module.exports=(req,next)=>{
    //解决跨域问题，这样子无法携带cookiereq.headers.origin
    let cross = req.headers.referer?req.headers.referer.substring(0,req.headers.referer.length-1):"*";
    async_global.res.setHeader("Access-Control-Allow-Origin", cross);
    async_global.res.setHeader("Access-Control-Allow-Credentials","true")
    async_global.res.setHeader('Access-Control-Allow-Headers', 'Content-Type, X-Token, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild');
    //设置默认类型为utf-8
    async_global.res.setHeader("Content-Type", "text/html; charset=utf-8");
}